home *** CD-ROM | disk | FTP | other *** search
- class Queue extends Array
- {
- var path;
- var joinedQueueHandler;
- static var QUEUE_SEPARATION = 8;
- function Queue(p, jqh)
- {
- super();
- this.path = p;
- this.joinedQueueHandler = jqh;
- }
- function joinedQueue(kid)
- {
- this.push(kid);
- this.joinedQueueHandler();
- }
- function getKidAtFrontOfQueue()
- {
- var _loc2_ = this.shift();
- this.kidLeaveQueue();
- return _loc2_;
- }
- function kidLeaveQueue()
- {
- var _loc3_ = undefined;
- var _loc4_ = undefined;
- var _loc2_ = 0;
- while(_loc2_ < this.length)
- {
- _loc3_ = this[_loc2_].distAlongPath;
- _loc4_ = this.path.length - _loc2_ * Queue.QUEUE_SEPARATION;
- this[_loc2_].followPath(this.path,Delegate.create(this[_loc2_].mc,this[_loc2_].mc.setPose,KidMc.IDLE),_loc4_,_loc3_);
- _loc2_ = _loc2_ + 1;
- }
- }
- }
-